<!DOCTYPE html>
<!-- 会员后台页面 -->
<html>
<head>
  <meta charset="utf-8">
  <title>增加和修改</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 
  <link rel="stylesheet" href="../../res/css/wholesale/font.css">
  <link rel="stylesheet" href="../../res/css/wholesale/xadmin.css">
  <link rel="stylesheet" href="../../res/layui/css/layui.css">
  <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="../../res/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="../../res/js/wholesale/xadmin.js"></script>
</head>
<body>
	<form id="form" class="layui-form" action="../../listenCompany/add.action" method="post" style="margin-top: 10px;" >
	<input type="hidden" name="companyId" id="companyId">
	 
	  <div  class="layui-form-item" style="width:70%;margin-left: 52px;">
	    <label class="layui-form-label">公司名称:</label>
		    <div class="layui-input-block">
		      <input name="companyName" id="companyName"  maxlength="10" required lay-verify="required" autocomplete="off" placeholder="请输入公司名称" class="layui-input" type="text" >
		    </div>
	  	</div>
	  	
	  <div  class="layui-form-item" style="width:70%;margin-left: 52px;">
	    <label class="layui-form-label">公司地址:</label>
		    <div class="layui-input-block">
		      <input name="companyAddress" id="companyAddress"  maxlength="20" required lay-verify="required"  autocomplete="off" placeholder="请输入公司地址" class="layui-input" type="text" >
		    </div>
	  	</div>
	  	
	  <div  class="layui-form-item" style="width:70%;margin-left: 52px;">
	    <label class="layui-form-label">公司类型:</label>
		    <div class="layui-input-block">
		      <input name="companyType" id="companyType"  maxlength="10" required lay-verify="required" autocomplete="off" placeholder="请输入公司类型" class="layui-input" type="text" >
		    </div>
	  	</div>

	  <div class="layui-form-item" style="width:70%;margin-left: 52px; ">
	    <div class="layui-input-block">
	      <input type="button" class="layui-btn" lay-submit lay-filter="formEdit" value="立即提交">
	    </div>
	   </div>
	</form>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript">
layui.use(['form', 'layedit', 'laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer
	  ,layedit = layui.layedit
	  ,laydate = layui.laydate;
	 
	 	 //日期
		  laydate.render({
		    elem: '#date'
		  });
	  
	  //创建一个编辑器
	  var editIndex = layedit.build('LAY_demo_editor');
	 
	  //自定义验证规则
	  form.verify({
	    title: function(value){
	      if(value.length > 7){
	        return '字数不能过大';
	      }
	    }
	    ,content: function(value){
	      layedit.sync(editIndex);
	    }
	  });
	 

	  //监听提交
	  form.on('submit(formDemo)', function(data){
		  var index=parent.layer.getFrameIndex(window.name);
		  parent.layer.close(index);
		  
	  });
	  
});
//接收到ajax传过来的对象 
function load() {
	var form = layui.form;
	 form.render();
}
</script>
</body>
</html>